package cn.creditms.consumer.controller;

import cn.creditms.consumer.feign.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.creditms.consumer.entity.User;

import java.util.List;

@RestController
public class ConsumerController {

  @Autowired
  private UserFeignClient userFeignClient;

  @GetMapping("/consumer/{id}")
  public List<User> findById1(@PathVariable Long id) {
    return this.userFeignClient.test02(id);
  }

  @PostMapping("/consumer/{id}")
  public List<User> findById2(@PathVariable Long id) {
    return this.userFeignClient.test02(id);
  }

}
